<%@page import="tx.bjdacp.model.*" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ include file="/commons/taglibs.jsp" %>

<rapid:override name="head">
	<title><%=GspInfo.TABLE_ALIAS%> 维护</title>

	<link href="<c:url value="/widgets/simpletable/simpletable.css"/>" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<c:url value="/widgets/simpletable/simpletable.js"/>"></script>

	<script type="text/javascript" >
		$(document).ready(function() {
			// 分页需要依赖的初始化动作
			window.simpleTable = new SimpleTable('queryForm',${page.thisPageNumber},${page.pageSize},'${pageRequest.sortColumns}');
		});
	</script>
</rapid:override>

<rapid:override name="content">
<s:bean name="tx.bjdacp.service.DataDictManager" var="dataDictManager" ></s:bean>

	<form id="queryForm" name="queryForm" action="<c:url value="/pages/GspInfo/list.do"/>" method="post" style="display: inline;">
	<s:hidden id="drugSellUnitId" name="drugSellUnitId" />
	<div class="queryPanel">
		<fieldset>
			<legend>搜索</legend>
			<table>
				<tr>
					<td class="tdLabel"><%=GspInfo.ALIAS_QUARTER%></td>
					<td>
					<s:select label="%{@tx.bjdacp.model.GspInfo@ALIAS_QUARTER}"  list="#dataDictManager.findAllByTypeQuarter()"
				                key="quarter"  headerKey=""  headerValue="请选择..." listValue="ddName" listKey="ddValue" theme="simple"/>
					</td>
					<td class="tdLabel"><%=GspInfo.ALIAS_ACCEPT_CODE%></td>
					<td>
						<input value="${query.acceptCode}" id="acceptCode" name="acceptCode" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=GspInfo.ALIAS_ACCEPT_DATE%></td>
					<td>
						<input value="<fmt:formatDate value='${query.acceptDateBegin}' pattern='<%=GspInfo.FORMAT_ACCEPT_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=GspInfo.FORMAT_ACCEPT_DATE%>'})" id="acceptDateBegin" name="acceptDateBegin"   />
						<input value="<fmt:formatDate value='${query.acceptDateEnd}' pattern='<%=GspInfo.FORMAT_ACCEPT_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=GspInfo.FORMAT_ACCEPT_DATE%>'})" id="acceptDateEnd" name="acceptDateEnd"   />
					</td>
					<td class="tdLabel"><%=GspInfo.ALIAS_UNIT_NAME%></td>
					<td>
						<input value="${query.unitName}" id="unitName" name="unitName" maxlength="100"  class=""/>
					</td>
				</tr>
				<tr>
					<td class="tdLabel"><%=GspInfo.ALIAS_CERT_TYPE%></td>
					<td>
					<s:select list="{'零售','零售（集中设库）','零售（连锁）','批发'}"  key="certType" label="%{@tx.bjdacp.model.GspInfo@ALIAS_CERT_TYPE}" theme="simple" headerKey=""  headerValue="请选择..."></s:select>
					</td>
					<td class="tdLabel"><%=GspInfo.ALIAS_CERT_KIND%></td>
					<td>
						<s:select list="{'首次认证','换证','追踪'}"  key="certKind" label="%{@tx.bjdacp.model.GspInfo@ALIAS_CERT_KIND}" theme="simple" headerKey=""  headerValue="请选择..."></s:select>
					</td>
					<td class="tdLabel"><%=GspInfo.ALIAS_CERT_RESULT%></td>
					<td>
						<s:select list="{'通过','整改三个月','整改六个月','不合格','撤销'}"  key="certResult" label="%{@tx.bjdacp.model.GspInfo@ALIAS_CERT_RESULT}" theme="simple" headerKey=""  headerValue="请选择..."></s:select>
					</td>
					<td class="tdLabel"><%=GspInfo.ALIAS_CERT_BUG_ITEM%></td>
					<td>
						<input value="${query.certBugItem}" id="certBugItem" name="certBugItem" maxlength="100"  class=""/>
					</td>
				</tr>
				<tr>
					<td class="tdLabel"><%=GspInfo.ALIAS_GSP_CODE%></td>
					<td>
						<input value="${query.gspCode}" id="gspCode" name="gspCode" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=GspInfo.ALIAS_GSP_GIVE_DATE%></td>
					<td>
						<input value="<fmt:formatDate value='${query.gspGiveDateBegin}' pattern='<%=GspInfo.FORMAT_GSP_GIVE_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=GspInfo.FORMAT_GSP_GIVE_DATE%>'})" id="gspGiveDateBegin" name="gspGiveDateBegin"   />
						<input value="<fmt:formatDate value='${query.gspGiveDateEnd}' pattern='<%=GspInfo.FORMAT_GSP_GIVE_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=GspInfo.FORMAT_GSP_GIVE_DATE%>'})" id="gspGiveDateEnd" name="gspGiveDateEnd"   />
					</td>
					<td class="tdLabel"><%=GspInfo.ALIAS_GSP_EXPIRY_DATE%></td>
					<td>
						<input value="<fmt:formatDate value='${query.gspExpiryDateBegin}' pattern='<%=GspInfo.FORMAT_GSP_EXPIRY_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=GspInfo.FORMAT_GSP_EXPIRY_DATE%>'})" id="gspExpiryDateBegin" name="gspExpiryDateBegin"   />
						<input value="<fmt:formatDate value='${query.gspExpiryDateEnd}' pattern='<%=GspInfo.FORMAT_GSP_EXPIRY_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=GspInfo.FORMAT_GSP_EXPIRY_DATE%>'})" id="gspExpiryDateEnd" name="gspExpiryDateEnd"   />
					</td>
					<td class="tdLabel"><%=GspInfo.ALIAS_SEND_DATE%></td>
					<td>
						<input value="<fmt:formatDate value='${query.sendDateBegin}' pattern='<%=GspInfo.FORMAT_SEND_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=GspInfo.FORMAT_SEND_DATE%>'})" id="sendDateBegin" name="sendDateBegin"   />
						<input value="<fmt:formatDate value='${query.sendDateEnd}' pattern='<%=GspInfo.FORMAT_SEND_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=GspInfo.FORMAT_SEND_DATE%>'})" id="sendDateEnd" name="sendDateEnd"   />
					</td>
				</tr>

			</table>
		</fieldset>
		<div class="handleControl">
			<input type="submit" class="stdButton" style="width:80px" value="查询" onclick="getReferenceForm(this).action='${ctx}/pages/GspInfo/list.do'"/>
			<!--<input type="submit" class="stdButton" style="width:80px" value="新增" onclick="getReferenceForm(this).action='${ctx}/pages/GspInfo/create.do'"/>-->
			<input type="button" class="stdButton" style="width:80px" value="删除" onclick="batchDelete('${ctx}/pages/GspInfo/delete.do','items',document.forms.queryForm)"/>
					    	<input type="submit" class="stdButton" style="width:80px" value="导出Excel" onclick="getReferenceForm(this).action='${ctx}/pages/GspInfo/listExcel.do'"/>

		<div>
	</div>

	<div class="gridTable">

		<simpletable:pageToolbar page="${page}">
		</simpletable:pageToolbar>

		<table width="100%"  border="0" cellspacing="0" class="gridBody">
		  <thead>

			  <tr>
				<th style="width:1px;"> </th>
				<th style="width:1px;"><input type="checkbox" onclick="setAllCheckboxState('items',this.checked)"></th>

				<!-- 排序时为th增加sortColumn即可,new SimpleTable('sortColumns')会为tableHeader自动增加排序功能; -->
				<th sortColumn="accept_code" ><%=GspInfo.ALIAS_ACCEPT_CODE%></th>
				<th sortColumn="accept_date" ><%=GspInfo.ALIAS_ACCEPT_DATE%></th>
				<th sortColumn="unit_name" ><%=GspInfo.ALIAS_UNIT_NAME%></th>
				<th sortColumn="cert_type" ><%=GspInfo.ALIAS_CERT_TYPE%></th>
				<th sortColumn="cert_kind" ><%=GspInfo.ALIAS_CERT_KIND%></th>
				<th sortColumn="cert_result" ><%=GspInfo.ALIAS_CERT_RESULT%></th>
				<th sortColumn="cert_bug_item" ><%=GspInfo.ALIAS_CERT_BUG_ITEM%></th>
				<th sortColumn="gsp_code" ><%=GspInfo.ALIAS_GSP_CODE%></th>
				<th sortColumn="gsp_give_date" ><%=GspInfo.ALIAS_GSP_GIVE_DATE%></th>
				<th sortColumn="gsp_expiry_date" ><%=GspInfo.ALIAS_GSP_EXPIRY_DATE%></th>
				<th sortColumn="send_date" ><%=GspInfo.ALIAS_SEND_DATE%></th>
				<th sortColumn="quarter" ><%=GspInfo.ALIAS_QUARTER%></th>

				<th>操作</th>
			  </tr>

		  </thead>
		  <tbody>
		  	  <c:forEach items="${page.result}" var="item" varStatus="status">

			  <tr class="${status.count % 2 == 0 ? 'odd' : 'even'}">
				<td>${page.thisPageFirstElementNumber + status.index}</td>
				<td><input type="checkbox" name="items" value="gspInfoId=${item.gspInfoId}&"></td>

				<td><c:out value='${item.acceptCode}'/>&nbsp;</td>
				<td><c:out value='${item.acceptDateString}'/>&nbsp;</td>
				<td><c:out value='${item.unitName}'/>&nbsp;</td>
				<td><c:out value='${item.certType}'/>&nbsp;</td>
				<td><c:out value='${item.certKind}'/>&nbsp;</td>
				<td><c:out value='${item.certResult}'/>&nbsp;</td>
				<td><c:out value='${item.certBugItem}'/>&nbsp;</td>
				<td><c:out value='${item.gspCode}'/>&nbsp;</td>
				<td><c:out value='${item.gspGiveDateString}'/>&nbsp;</td>
				<td><c:out value='${item.gspExpiryDateString}'/>&nbsp;</td>
				<td><c:out value='${item.sendDateString}'/>&nbsp;</td>
				<td><c:out value='${item.quarter}'/>&nbsp;</td>
				<td>
					<a href="${ctx}/pages/GspInfo/show.do?gspInfoId=${item.gspInfoId}&">查看</a>&nbsp;&nbsp;&nbsp;
					<a href="${ctx}/pages/GspInfo/edit.do?gspInfoId=${item.gspInfoId}&">修改</a>
				</td>
			  </tr>

		  	  </c:forEach>
		  </tbody>
		</table>

		<simpletable:pageToolbar page="${page}">
		</simpletable:pageToolbar>
	</div>
	</form>
</rapid:override>

<%-- jsp模板继承,具体使用请查看: http://code.google.com/p/rapid-framework/wiki/rapid_jsp_extends --%>
<%@ include file="base.jsp" %>

